<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>航线舱位视图——恒拓运价魔方</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<meta http-equiv="imagetoolbar" content="no" />

<meta name="apple-mobile-web-app-capable" content="yes" />

<link href="<%=request.getContextPath()%>/resources/css/jquery-ui-themes.css" type="text/css"
	rel="stylesheet">

<link href="<%=request.getContextPath()%>/resources/css/axure_rp_page.css" type="text/css"
	rel="stylesheet">

<link href="<%=request.getContextPath()%>//axurerp_pagespecificstyles.css" type="text/css"
	rel="stylesheet">
<!--[if IE 6]>

    <link href="<%=request.getContextPath()%>/axurerp_pagespecificstyles_ie6.css" type="text/css" rel="stylesheet">
<![endif]-->

<%-- <script type="text/javascript" src="${pageContext.request.contextPath}/fare/js/show.js"></script>--%>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/js/jquery-1.6.4.min.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/js/datePicker/WdatePicker.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/FusionCharts/FusionCharts.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/fare/lib/ligerUI/js/ligerui.min.js"></script>
<link href="<%=request.getContextPath()%>/fare/lib/ligerUI/skins/Aqua/css/ligerui-all.css"
	rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/fare/css/base.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jsFile/common.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jsFile/multiblepicker.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/jsFile/FDCDialog.js"></script>
<link
	href='<%=request.getContextPath()%>/fare/js/cityquery/cityquery.css'
	rel="stylesheet" type="text/css" />
<script type='text/javascript'
	src='<%=request.getContextPath()%>/fare/js/cityquery/citylist.js'></script>
<script type='text/javascript'
	src='<%=request.getContextPath()%>/fare/js/cityquery/querycity.js'></script>
	
	<link rev="stylesheet" media="all" href="<%=request.getContextPath() %>/fare/css/form_style.css" type="text/css" rel="stylesheet">
	
	<script type="text/javascript">
	var CustomersData = 
	{Rows:[{"line":"A","date":"3400","siteName":"100%","carrier":"28","flightNo":"10","price":"18","depTime":"12206","arrTime":"12209","agentName":"Germany","bookingType":"10%"},
	       {"line":"B","date":"2509","siteName":"97%","carrier":"46","flightNo":"24","price":"22","depTime":"12203","arrTime":"12209","agentName":"Germany","bookingType":"12%"},
	       {"line":"C","date":"2680","siteName":"200%","carrier":"72","flightNo":"40","price":"2","depTime":"12206","arrTime":"12209","agentName":"Germany","bookingType":"13%"},
	       {"line":"D","date":"3666","siteName":"220%","carrier":"16","flightNo":"10","price":"11","depTime":"12206t","arrTime":"12209","agentName":"Germany","bookingType":"14%"},
	       {"line":"E","date":"5444","siteName":"320%","carrier":"28","flightNo":"20","price":"15","depTime":"12206","arrTime":"12209","agentName":"Germany","bookingType":"14%"},
	       {"line":"F","date":"2432","siteName":"233%","carrier":"22","flightNo":"20","price":"8","depTime":"12206","arrTime":"12209","agentName":"Germany","bookingType":"12%"},
	       {"line":"G","date":"3356","siteName":"150%","carrier":"13","flightNo":"8","price":"10","depTime":"12206","arrTime":"12209","agentName":"Germany","bookingType":"18%"}]};
	var columns_main = [
	     			   { display: '舱位名称', name: 'line', minWidth: 100 },
	                    { display: '运价', name: 'date', minWidth: 140 },
	                    { display: '折扣', name: 'siteName' },
	                    { display: '开放舱位数', name: 'carrier' },
	                    { display: '已售数', name: 'flightNo' },
	                    { display: '剩余数', name: 'price' },
	                    { display: '起飞时间', name: 'depTime' },
	                    { display: '降落时间', name: 'arrTime' },
	                    { display: '代理人', name: 'agentName' },
	                    { display: '舱位分布占比', name: 'bookingType' }
	                    ];

	     function showm(sid){

	     var which = document.getElementById("lite" + sid);
	     var imgmenu = document.getElementById("ling" + sid);
	     	if (which.style.display == "none"){
	     		document.getElementById("lite" + sid).style.display="";
	     	}
	     	else{
	     		document.getElementById("lite" + sid).style.display="none";
	     		}
	     }

	     function currentDate(){ 
	         var now = new Date();       
	         var year = now.getFullYear();
	         var month = now.getMonth() + 1;
	         var day = now.getDate();
	        
	         var today = year + "-";       
	         if(month < 10)
	             today += "0";       
	         today += month + "-";       
	         if(day < 10)
	             today += "0";           
	         today += day;       
	         return(today); 
	     } 

	     $(function(){
	     	var grid = $("#maingrid");
	     	loadAndDisplayData(grid,'lowestPriceQueryAction!analyse.action');
	     	grid.ligerGrid({
	             height:'200px',
	             columns:columns_main,
	             data:CustomersData
	         });
	     	var columns = [ { display: '网站名称', name: 'channel', align: 'center', width: 440, minWidth: 60 } ];
	     	registPicker('channels',"pageUtilAction!channels.action",columns,540,'channel');
	     	$('#depCity').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
	     	$('#arrCity').querycity({'data':citysFlight,'tabs':labelFromcity,'hotList':hotList});
	     	var dataGridColumns = [{ header: '航空公司名', name: 'name' }];
	     	registSimplePicker('carriers',"pageUtilAction!carriers.action",dataGridColumns,150,'name');
	     	if($('#grapDate').val()==''){
	     		$('#grapDate').val(currentDate());
	     	}	
	     })



	     function funsFs(valu){
	     	$('#fangshi').val(valu);
	     }

	     function loadAndDisplayData(grid,url){
	     	if($('#depCity').val()!=''&&$('#arrCity').val()){
	     		$.ajax({
	     	        url : url,
	     	        data:{
	     	        	depCity:$('#depCity').val(),
	     	        	arrCity:$('#arrCity').val(),
	     	        	beginDateAfterToday:$('#beginDateAfterToday').val(),
	     	        	endDateAfterToday:$('#endDateAfterToday').val(),
	     	        	channels:$('#channels').val(),   
	     	        	priceType:$('#priceType').val(),
	     	        	grapDate:$('#grapDate').val(),
	     	        	bookingType:$('#bookingType').val(),
	     	        	flightNos:$('#flightNos').val(),
	     	        	carriers:$('#carriers').val()
	     	        	},
	     	        cache : false, 
	     	        async : false,
	     	        type : "POST",
	     	       	complete: function(jqXHR, textStatus){
	     	       		if(jqXHR.status==200){
	     	       			result = parseObj(jqXHR.responseText);
	     	       			var data = result.json;
	     	       			grid.ligerGrid({
	     		        		height:'300px',
	     		                columns:columns_main,
	     		                data:CustomersData,
	     		                pageSize:10,
	     		                rownumbers:true
	     		            });
	     	       			if(data.Total!=0){			        	
	     	       				$("#norecord").attr('style','display:none');
	     	       				$("#maingrid").attr('style','margin-top:30px;');
	     	       			}else{
	     	       				$("#norecord").attr('style','margin-top:30px;margin-bottom:1px;display:block;color:red');
	     	       				$("#maingrid").attr('style','margin-top:1px;');
	     	       				
	     	       			}
	     	       		}else{
	     	       			alert('查询失败,请与管理员联系');
	     	       		}
	     	       	}
	     	    });
	     	}
	     	FDCDialog.unLockWindow();
	     }

	     function changeAction(url){
	     	$('#channel').attr('action',url);
	     }


	     function getFlightNos(){
	     	var result = {"Total":2,"Rows":[{"flightNo":"CZ6158","fromCity":"PEK","toCity":"HAK","fromCityName":"北京","toCityName":"海口"},{"flightNo":"CZ6720","fromCity":"PEK","toCity":"HAK","fromCityName":"北京","toCityName":"海口"}]}
	     	var columns2 = [ { display: '航班选择', name: 'flightNo', align: 'center', width: 440, minWidth: 60 } ];
	     	var dep = $('#depCity').val();
	     	var arr = $('#arrCity').val();
	     	if(dep !="中文/拼音"&&dep&&arr !="中文/拼音"&&arr){
	     		registPicker('flightNos',"pageUtilAction!flightsOfLine.action",columns2,460,'flightNo'); 
	     	}
	     }

	     function checkForm(){
	     	if($('#depCity').val()=='中文/拼音' || $('#arrCity').val()=='中文/拼音'){
	     		if(!window.confirm('航段不选，查询比较耗时，是否继续？')){
	     	        return false;
	     	     }
	     	}
	     	if($("#beginDateAfterToday").val()!=parseInt($("#beginDateAfterToday").val()) || $("#beginDateAfterToday").val()*1<0 || $("#beginDateAfterToday").val()*1>180){	
	     		alert("航班日期:未来_到_天航班 只能为整数,范围0-180天!");
	     		$("#beginDateAfterToday").focus();
	     		return false;
	     	}
	     	$("#beginDateAfterToday").val(parseInt($("#beginDateAfterToday").val()));
	     	
	     	if($("#endDateAfterToday").val()!=parseInt($("#endDateAfterToday").val()) || $("#endDateAfterToday").val()*1<0 || $("#endDateAfterToday").val()*1>180){	
	     		alert("航班日期:未来_到_天航班 只能为整数,范围0-180天!");
	     		$("#endDateAfterToday").focus();
	     		return false;
	     	}
	     	$("#endDateAfterToday").val(parseInt($("#endDateAfterToday").val()));
	     	
	     	return true;
	     }
	     function checkJspForm(){
	     	
	     	if(!checkForm()){
	     		return false;
	     	}
	     	//目前的数据时净价和预订,临时解决方案
	     	if($('#priceType').val()=='2' || $('#bookingType').val()=='2'){
	     		$('#maingrid').ligerGrid({
	         		height:'300px',
	                 columns:columns_main,
	                 data:CustomersData,
	                 pageSize:10,
	                 rownumbers:true
	             });
	     		$("#norecord").attr('style','margin-top:30px;margin-bottom:1px;display:block;color:red');
	     		$("#maingrid").attr('style','margin-top:1px;');
	     		return false;
	     	}
	     	
	     	changeAction('lowestPriceQueryAction!toAnalyseJSP.action');
	     	FDCDialog.lockWindow(true,'/fdc-web');
	     	setTimeout(function(){loadAndDisplayData($('#maingrid'),'lowestPriceQueryAction!analyse.action');},1);
	     }
	     function checkExcelForm(){
	     	if(!checkForm()){
	     		return false;
	     	}  
	     	changeAction('lowestPriceQueryAction!toExcel.action');
	     	$('#channel').submit();
	     }

	     function showhangduan(){
	     	var columns_main = [
	     	     			   { display: '始点', name: 'fromcity' },
	     	                    { display: '终点', name: 'tocity' }
	     	                    ];
	     	
	     	if($("#hangduandata").css('display')=='none') {
	     		var grid = $("#hangduandata");
	     		grid.show();
	     		url = 'lowestPriceQueryAction!queryHangduanVos.action';
	     		$.ajax({
	     	        url : url,
	     	        data:{channels:$('#channels').val()},
	     	        cache : false, 
	     	        async : false,
	     	        type : "POST",
	     	       	complete: function(jqXHR, textStatus){
	     	       		if(jqXHR.status==200){
	     	       			result = parseObj(jqXHR.responseText);
	     	       			var data = result.json;
	     	       			grid.ligerGrid({
	     		        		height:'300px',
	     		                columns:columns_main,
	     		                data:CustomersData,
	     		                pageSize:10,
	     		                rownumbers:true
	     		            });
	     	       		}else{
	     	       			alert('查询失败,请与管理员联系');
	     	       		}
	     	       	}
	     	    });
	     	}else{
	     		$("#hangduandata").hide();
	     	}
	     }
	</script>

<style type="text/css"/>
h4{font-size:14px;line-height:40px;font-weight:bold;margin-top:15px;}
</style>
</head>

<body>
<jsp:include page="../../inc/treelist2.jsp"></jsp:include>
<div class="main main_max minhgt450">
	<div class="sideBar">
	<div class="box">
		<div class="location">当前位置： 收益分析 &gt; 航线舱位视图</div>
	</div>
	</div>
<div class="form_table_tltle">运价查询 </div>
<form id="lsyjzst" method="post">
<table cellSpacing=0 cellPadding=0 width="100%" border=0 class="form_table">
  <TR>
    <TD width="120" height="26" class="left" style="text-align:left">航空公司：</TD>
    <TD width="300">
     	<select id="companySelect" name="companySelect">
			<option value="cs" selected="selected">南航</option>
			<option value="ds">中航</option>
			<option value="as" >深航</option>
	    </select>
    </TD>
  	<TD width="120" height="26" class="left" style="text-align:left">航程：</TD>
  	<TD>
  	 	<input type="radio" name="dataSource" value="web" />单程
  	 	<input type="radio" name="dataSource" value="all" />来回程
  	</TD>
  </TR>
  <TR>
   <TD height="26" class="left" style="text-align:left">航&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;段：</TD>
    <TD>
      <span>从</span>
      <input type="text" style="width:100px" name="depCity" id="depCity"  value="">
      <span>到</span>
      <input type="text" style="width:100px" name="arrCity" id="arrCity" value="">
    </TD>
    <TD height="26" class="left" style="text-align:left">航班：</TD>
  	<TD>
  		<select name="flightTime">
			<option value="time1" selected="selected">02:00</option>
			<option value="time2">03:00</option>
			<option value="time3" >04:00</option>
	    </select>
  	</TD>
  </TR>
  <TR>
    <TD class="left" style="text-align:left">出发日期：</TD>
    <TD>
      <input type="text" style="width:70px" name="beginDate" id="beginDate" onclick="WdatePicker({dateFmt:'yyyy/MM/dd'})" required>
      <span>至</span>
      <input type="text" style="width:70px" name="endDate" id="endDate" onclick="WdatePicker({dateFmt:'yyyy/MM/dd'})" required>
      <span></span>
      <span style="color:#ff0000">*</span>
	</TD>
	
	 <TD class="left" style="text-align:left">抓取时段：</TD>
    <TD>
      <input type="text" style="width:70px" name="beginDate" id="beginDate" onclick="WdatePicker({dateFmt:'yyyy/MM/dd'})" required>
      <span>至</span>
      <input type="text" style="width:70px" name="endDate" id="endDate" onclick="WdatePicker({dateFmt:'yyyy/MM/dd'})" required>
      <span></span>
      <span style="color:#ff0000">*</span>
	</TD>
  </TR>
  <TR>
  	<TD height="26" class="left" style="text-align:left">出发时段：</TD>
  	<TD>
  	  <input type="checkbox" name="checkbox"  value="morning" onclick="selectOne(this)">上午
  	  <input type="checkbox" name="checkbox" value="noon" onclick="selectOne(this)">中午
  	  <input type="checkbox" name="checkbox" value="afternoon" onclick="selectOne(this)">下午
  	  <input type="checkbox" name="checkbox" value="night" onclick="selectOne(this)">晚上
  	</TD>
  	<TD height="26" class="left" style="text-align:left">自定义：</TD>
  	<TD colspan="1">
  	  <input name="depTimeHour1" type="text" id="depTimeHour1" maxlength="2" style="width:20px"  value="" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">&nbsp;：
  	  <input name="depTimeMin1" type="text" id="depTimeMin1" maxlength="2" style="width:20px" value="" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">&nbsp;到&nbsp;
  	   <input name="depTimeHour2" type="text" id="depTimeHour2" maxlength="2" style="width:20px" value="" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">&nbsp;：
  	  <input name="depTimeMin2" type="text" id="depTimeMin2" maxlength="2" style="width:20px" value="" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"> 
  	</TD>
  </TR>
  
  <TR>
    <TD style="text-align:center;height:35px;" colspan="4">
      <input type="button" name="searchButton" value="" class="btn01" onclick="" id="searchButton" />
      <input type="button" name="clearButton" value="" class="btn02" onclick="clearAll()" id="clearButton" />
    </TD>
  </TR>
</TABLE>
</form>
	<div class="form_table_tltle">去程</div>
	<div id="maingrid" style="margin-top:30px;"></div>
</div>
<jsp:include page="../../inc/footer2.jsp"></jsp:include>
<script src="${pageContext.request.contextPath}/resources/scripts/axurerp_pagescript.js"></script>
<script src="${pageContext.request.contextPath}/axurerp_pagespecificscript.js" charset="utf-8"></script>
</body>
